//
// Created by s on 2025/10/14.
//

#ifndef COREXY_INTERFACE_H
#define COREXY_INTERFACE_H
#include <usart.h>
#include "../Kinematics/kinematics.h"

extern __IO uint8_t rx_data[8];
extern __IO Coordinate TargetCordi;
extern __IO Coordinate NowCordi;
extern __IO bool isRxTarget;

float ParserAngle(const uint8_t *receive_data);


void UART_Send(uint8_t *data, uint8_t length);

/*解码函数*/
Coordinate DataPaser();

void VelControl(uint8_t id, uint8_t direction, uint16_t speed, uint8_t acceleration, bool all_flag);

void PosControl(uint8_t id, uint8_t direction, uint16_t speed, uint8_t acceleration, float round, bool re_ab_flag, bool all_flag);

void MoveTrigger();

void EmergencyStop(uint8_t id, bool all_flag);

float ParserAngle(const uint8_t *receive_data);

void ReadAngle(uint8_t id);

#endif //COREXY_INTERFACE_H
